﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PortaCapena.OdooJsonRpcClient.Attributes;
using PortaCapena.OdooJsonRpcClient.Converters;
using PortaCapena.OdooJsonRpcClient.Models;
using System;
using System.ComponentModel;
using System.Runtime.Serialization;


namespace OdooRpcClient.Model.Hr
{
    [OdooTableName("hr.job")]
    [JsonConverter(typeof(OdooModelConverter))]
    public class HrJobOdooModel : IOdooModel
    {

        /// <summary>
        /// Name
        /// Char
        /// required
        /// <summary>
        [JsonProperty("name")]
        [Description("Name")]
        public string Name { get; set; }

        /// <summary>
        /// ExpectedEmployees
        /// Integer
        /// Expected number of employees for this job position after new recruitment.
        /// <summary>
        [JsonProperty("expected_employees")]
        [Description("ExpectedEmployees")]
        public int? ExpectedEmployees { get; set; }

        /// <summary>
        /// NoOfEmployee
        /// Integer
        /// Number of employees currently occupying this job position.
        /// <summary>
        [JsonProperty("no_of_employee")]
        [Description("NoOfEmployee")]
        public int? NoOfEmployee { get; set; }

        /// <summary>
        /// NoOfRecruitment
        /// Integer
        /// Number of new employees you expect to recruit.
        /// <summary>
        [JsonProperty("no_of_recruitment")]
        [Description("NoOfRecruitment")]
        public int? NoOfRecruitment { get; set; }

        /// <summary>
        /// NoOfHiredEmployee
        /// Integer
        /// Number of hired employees for this job position during recruitment phase.
        /// <summary>
        [JsonProperty("no_of_hired_employee")]
        [Description("NoOfHiredEmployee")]
        public int? NoOfHiredEmployee { get; set; }

        /// <summary>
        /// EmployeeIds
        /// One2many
        /// hr.employee
        /// job_id
        /// <summary>
        [JsonProperty("employee_ids")]
        [Description("EmployeeIds")]
        public long[] EmployeeIds { get; set; }

        /// <summary>
        /// Description
        /// Text
        /// <summary>
        [JsonProperty("description")]
        [Description("Description")]
        public string Description { get; set; }

        /// <summary>
        /// Requirements
        /// Text
        /// <summary>
        [JsonProperty("requirements")]
        [Description("Requirements")]
        public string Requirements { get; set; }

        /// <summary>
        /// DepartmentId
        /// Many2one
        /// hr.department
        /// <summary>
        [JsonProperty("department_id")]
        [Description("DepartmentId")]
        public long? DepartmentId { get; set; }

        /// <summary>
        /// CompanyId
        /// Many2one
        /// res.company
        /// <summary>
        [JsonProperty("company_id")]
        [Description("CompanyId")]
        public long? CompanyId { get; set; }

        /// <summary>
        /// State
        /// Selection
        /// Set whether the recruitment process is open or closed for this job position.
        /// required
        /// <summary>
        [JsonProperty("state")]
        [Description("State")]
        public StatusHrJobOdooEnum State { get; set; }

        /// <summary>
        /// MessageIsFollower
        /// Boolean
        /// <summary>
        [JsonProperty("message_is_follower")]
        [Description("MessageIsFollower")]
        public bool? MessageIsFollower { get; set; }

        /// <summary>
        /// MessageFollowerIds
        /// One2many
        /// mail.followers
        /// res_id
        /// <summary>
        [JsonProperty("message_follower_ids")]
        [Description("MessageFollowerIds")]
        public long[] MessageFollowerIds { get; set; }

        /// <summary>
        /// MessagePartnerIds
        /// Many2many
        /// res.partner
        /// <summary>
        [JsonProperty("message_partner_ids")]
        [Description("MessagePartnerIds")]
        public long[] MessagePartnerIds { get; set; }

        /// <summary>
        /// MessageChannelIds
        /// Many2many
        /// mail.channel
        /// <summary>
        [JsonProperty("message_channel_ids")]
        [Description("MessageChannelIds")]
        public long[] MessageChannelIds { get; set; }

        /// <summary>
        /// MessageIds
        /// One2many
        /// mail.message
        /// res_id
        /// <summary>
        [JsonProperty("message_ids")]
        [Description("MessageIds")]
        public long[] MessageIds { get; set; }

        /// <summary>
        /// MessageUnread
        /// Boolean
        /// If checked, new messages require your attention.
        /// <summary>
        [JsonProperty("message_unread")]
        [Description("MessageUnread")]
        public bool? MessageUnread { get; set; }

        /// <summary>
        /// MessageUnreadCounter
        /// Integer
        /// Number of unread messages
        /// <summary>
        [JsonProperty("message_unread_counter")]
        [Description("MessageUnreadCounter")]
        public int? MessageUnreadCounter { get; set; }

        /// <summary>
        /// MessageNeedaction
        /// Boolean
        /// If checked, new messages require your attention.
        /// <summary>
        [JsonProperty("message_needaction")]
        [Description("MessageNeedaction")]
        public bool? MessageNeedaction { get; set; }

        /// <summary>
        /// MessageNeedactionCounter
        /// Integer
        /// Number of messages which requires an action
        /// <summary>
        [JsonProperty("message_needaction_counter")]
        [Description("MessageNeedactionCounter")]
        public int? MessageNeedactionCounter { get; set; }

        /// <summary>
        /// MessageHasError
        /// Boolean
        /// If checked, some messages have a delivery error.
        /// <summary>
        [JsonProperty("message_has_error")]
        [Description("MessageHasError")]
        public bool? MessageHasError { get; set; }

        /// <summary>
        /// MessageHasErrorCounter
        /// Integer
        /// Number of messages with delivery error
        /// <summary>
        [JsonProperty("message_has_error_counter")]
        [Description("MessageHasErrorCounter")]
        public int? MessageHasErrorCounter { get; set; }

        /// <summary>
        /// MessageAttachmentCount
        /// Integer
        /// <summary>
        [JsonProperty("message_attachment_count")]
        [Description("MessageAttachmentCount")]
        public int? MessageAttachmentCount { get; set; }

        /// <summary>
        /// MessageMainAttachmentId
        /// Many2one
        /// ir.attachment
        /// <summary>
        [JsonProperty("message_main_attachment_id")]
        [Description("MessageMainAttachmentId")]
        public long? MessageMainAttachmentId { get; set; }

        /// <summary>
        /// MessageHasSmsError
        /// Boolean
        /// If checked, some messages have a delivery error.
        /// <summary>
        [JsonProperty("message_has_sms_error")]
        [Description("MessageHasSmsError")]
        public bool? MessageHasSmsError { get; set; }

        /// <summary>
        /// Id
        /// Integer
        /// <summary>
        [JsonProperty("id")]
        [Description("Id")]
        public long Id { get; set; }

        /// <summary>
        /// DisplayName
        /// Char
        /// <summary>
        [JsonProperty("display_name")]
        [Description("DisplayName")]
        public string DisplayName { get; set; }

        /// <summary>
        /// CreateUid
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("create_uid")]
        [Description("CreateUid")]
        public long? CreateUid { get; set; }

        /// <summary>
        /// CreateDate
        /// Datetime
        /// <summary>
        [JsonProperty("create_date")]
        [Description("CreateDate")]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// WriteUid
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("write_uid")]
        [Description("WriteUid")]
        public long? WriteUid { get; set; }

        /// <summary>
        /// WriteDate
        /// Datetime
        /// <summary>
        [JsonProperty("write_date")]
        [Description("WriteDate")]
        public DateTime? WriteDate { get; set; }

        /// <summary>
        /// LastUpdate
        /// Datetime
        /// <summary>
        [JsonProperty("__last_update")]
        [Description("LastUpdate")]
        public DateTime? LastUpdate { get; set; }
    }


    // Set whether the recruitment process is open or closed for this job position.
    [JsonConverter(typeof(StringEnumConverter))]
    public enum StatusHrJobOdooEnum
    {
        [EnumMember(Value = "recruit")]
        RecruitmentInProgress = 1,

        [EnumMember(Value = "open")]
        NotRecruiting = 2,
    }

}
